<template>
  <swiper>
    <swiper-item v-for="item in banners">
      <template #default>
        <a :href="item.link">
          <img :src="item.image" alt="" @load="swiperImageLoad">
        </a>
      </template>
    </swiper-item>
  </swiper>
</template>

<script>
  import {Swiper, SwiperItem} from 'components/common/swiper/index'

  export default {
    name: "",
    data(){
      return {
        isLoad: false
      }
    },
    props: {
      banners: {
        type: Array,
        default(){
          return []
        }
      }
    },
    methods: {
      swiperImageLoad(){
        if(!this.isLoad){
          this.$emit('swiperImageLoad')
          this.isLoad = true
        }
      }
    },
    components: {
      Swiper,
      SwiperItem
    }
  }
</script>

<style lang="less" scoped>

</style>
